package com.zygh.lz.controller;

import com.zygh.lz.entity.Sptype;
import com.zygh.lz.service.SptypeService;
import com.zygh.lz.stapprove.ResultUtil;
import com.zygh.lz.stapprove.SysPcLog;
import com.zygh.lz.stapprove.ViLog;
import com.zygh.lz.vo.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@Api(tags = "勤务组类", description = "SptypeController")
public class SptypeController {

    @Resource
    private SptypeService sptypeService;

    @ApiOperation("添加特殊勤务树状结构")
    @PostMapping("/addSPtype")
    //@SysPcLog(module = "添加特殊勤务树状结构",operation = "新增")
    public ResultBean addSPtype(@RequestBody Sptype sptype){
        return sptypeService.addSPtype(sptype);
    }

    @ApiOperation("修改特殊勤务树状结构")
    @PostMapping("/updateSPtype")
    //@SysPcLog(module = "修改特殊勤务树状结构",operation = "修改")
    public ResultBean updateSPtype(@RequestBody Sptype sptype){
        return sptypeService.updateSPtype(sptype);
    }

    @ApiOperation("删除特殊勤务树状结构")
    @PostMapping("/deleteSPtype")
    //@SysPcLog(module = "删除特殊勤务树状结构",operation = "删除")
    public ResultBean deleteSPtype(@RequestBody Sptype sptype){
        return sptypeService.deleteSPtype(sptype.getId());
    }

    @ApiOperation("一键调度岗位类型")
    @PostMapping("/findDropDown")
    //@SysPcLog(module = "一键调度岗位类型",operation = "查询")
    public ResultBean findDropDown(){
        return sptypeService.findDropDown();
    }


}
